package study.saas.order.facade.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import study.saas.common.viewmodel.ApiResultV2;
import study.saas.common.viewmodel.PageModel;
import study.saas.order.entity.Commodity;
import study.saas.order.service.CommodityFacade;
import study.saas.order.service.CommodityService;
import study.saas.order.service.model.*;

import javax.annotation.Resource;
import java.util.List;

@Component("commodityFacade")
@Service(version = "1.0.0")
public class CommodityFacadelmpl implements CommodityFacade {
    @Resource
    private CommodityService service;


    @Override
    public ApiResultV2<Commodity> get(Integer id) {
        return service.get(id);
    }


    @Override
    public ApiResultV2 create(CommodityCreateDTO create) {
        return service.create(create);
    }

    @Override
    public ApiResultV2 decrease(CommodityDecreaseDTO decrease) {
        return service.decrease(decrease);
    }

    @Override
    public Commodity findCommodity(String commodityName) {
        return null;
    }

    @Override
    public ApiResultV2 delete(Integer id) {
        return service.delete(id);
    }



    @Override
    public ApiResultV2<PageModel<Commodity>> list(CommodityFilterDTO filter) {
        return service.list(filter);
    }


    @Override
    public Commodity findOne(Integer id) {
        return null;
    }

    @Override
    public Commodity save(Commodity entity) {
        return null;
    }

    @Override
    public List<Commodity> save(List<Commodity> entityList) {
        return null;
    }

    @Override
    public void deleteById(Integer id) {

    }
}
